<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加任务信息':action=='Modify'?'查询任务信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'equipment_task', 'form': 'dataForm' ,'primary_key':'Equipment_Task_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">任务信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">开始时间</div>
              </template>
              <el-form-item prop="Start_DateTime" :rules="[{ required: true, message: '请输入开始时间', trigger: 'blur' }]">
                <!-- <el-date-picker v-model="dataForm.Start_DateTime" type="datetime" placeholder="请选择开始时间"
                  class="borderless-input" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
                  size="large" /> -->
                <el-time-picker :disabled="action=='Modify'" format="HH:mm:ss" value-format="HH:mm:ss" v-model="dataForm.Start_DateTime"
                  class="borderless-input" :picker-options="{ selectableRange: '00:00:00 - 23:59:59' }"
                  placeholder="选择开始时间"></el-time-picker>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">结束时间</div>
              </template>
              <el-form-item prop="End_DateTime" :rules="[{ required: true, message: '请输入结束时间', trigger: 'blur' }]">
                <!-- <el-date-picker v-model="dataForm.End_DateTime" type="datetime" placeholder="请选择结束时间"
                  class="borderless-input" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
                  size="large" /> -->
                <el-time-picker :disabled="action=='Modify'" format="HH:mm:ss" value-format="HH:mm:ss" v-model="dataForm.End_DateTime"
                  class="borderless-input" :picker-options="{ selectableRange: '00:00:00 - 23:59:59' }"
                  placeholder="选择结束时间"></el-time-picker>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">频次/天</div>
              </template>
              <el-form-item prop="Times" :rules="[{ required: true, message: '请输入频次/天', trigger: 'blur' }]">
                <el-input-number :disabled="action=='Modify'" v-model="dataForm.Times" :min="1" label="请输入频次/天"></el-input-number>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">责任人</div>
              </template>
              <el-form-item prop="ID_Number" :rules="[{ required: true, message: '请选择责任人', trigger: 'change' }]">
                <yl-select :disabled="action=='Modify'" v-model="dataForm.ID_Number" clearable filterable placeholder="请选择责任人" :options="personal"
                  :props="{value:'ID_Card_Number',label:'Personal_Name'}">
                  <el-table-column prop="ID_Card_Number" width="180" show-overflow-tooltip  label="身份证号"></el-table-column>
                  <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                  <el-table-column prop="Birthday" show-overflow-tooltip label="出生日期"></el-table-column>
                  <el-table-column prop="Gender" label="性别"></el-table-column>
                  <el-table-column prop="Nation" label="民族"></el-table-column>
                  <el-table-column prop="Registered_Residence" show-overflow-tooltip label="籍贯"></el-table-column>
                  <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">适用设备</div>
              </template>
              <el-form-item prop="Times" :rules="[{ required: true, message: '请选择适用设备', trigger: 'blur' }]">
                <yl-select :disabled="action=='Modify'" v-model="equipment_task_detail" clearable filterable placeholder="请选择适用设备" :options="monitoring_equipment_detail"
                  :props="{value:'Monitoring_Equipment_Detail_SerialNumber',label:'label', multiple:true}">
                  <el-table-column prop="Monitoring_Equipment_Detail_SerialNumber" width="150" show-overflow-tooltip label="设备编号"></el-table-column>
                  <el-table-column prop="Monitoring_Equipment_Name" width="150"  show-overflow-tooltip label="设备类型"></el-table-column>
                  <el-table-column prop="Personal_Name" width="150" show-overflow-tooltip label="安装时间"></el-table-column>
                  <el-table-column prop="Grid_Name" width="150" show-overflow-tooltip label="所属网格"></el-table-column>
                  <el-table-column prop="Coordinate" width="100" show-overflow-tooltip label="坐标"></el-table-column>
                  <el-table-column min-width="250" show-overflow-tooltip label="地址">
                    <template v-slot="{row}">
                      {{row.Province}}{{row.City}}{{row.County}}{{row.Town}}{{row.Village}}
                    </template>
                  </el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">适用清运车</div>
            <div class="operation" v-if="action=='Add'">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm1')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm1')">删除</el-button>
            </div>
          </div>
          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'equipment_task_garbage_truck', 'form': 'childDataForm1', 'ParentTableName': 'equipment_task'})"
            :column="2" size="large" border
            v-for="(item,index) in childDataForm1.filter(item => item.Row_Status != '1')" :key="index">
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">清运车牌</div>
              </template>
              <el-input :disabled="action=='Modify'" v-model="item.Garbage_Truck_Number" class="borderless-input" placeholder="请输入清运车牌号" />
            </el-descriptions-item>
          </el-descriptions>
          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'equipment_task_detail', 'form': 'childDataForm', 'ParentTableName': 'equipment_task'})">
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button v-if="action=='Add'" type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>